function admin_type_add(){
	toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
	if($("#new_help_type").val() == ""){  
                toastr.warning("会员类型名不能为空！");  
                $("#new_help_type").focus();  
                return false;  
            } 
	var new_help_type = $('#new_help_type').val();
	var admin_type_add_do = $.ajax({
               type: "POST",
               url: "index.php?m=help&c=help_admin_type&a=admin_type_add_do",
               data: "new_help_type="+new_help_type,
               async: false
            }).responseText;
			if (admin_type_add_do == "1"){
				toastr.info("帮助类型已经存在，请重新添加！");
				self.location.reload();
			} else if (admin_type_add_do == "2") {
				toastr.success("成功添加新帮助类型！");
				self.location.reload();
			} else {
				toastr.error("请勿提交非法数据！");
				self.location.reload();
			}
}
function admin_type_edit(type_id){
	layer.open({
	type: 2,
	title: '修改帮助类型',
	maxmin: true,
	shadeClose: true, //点击遮罩关闭层
	area : ['360px' , '300px'],
	content: 'index.php?m=help&c=help_admin_type&a=admin_type_edit&type_id='+type_id,
	end: function () {
                location.reload();
            }
	});
}
function admin_type_del(type_id){
	toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
	var admin_type_del_do = $.ajax({
               type: "POST",
               url: "index.php?m=help&c=help_admin_type&a=admin_type_del_do",
               data: "type_id="+type_id,
               async: false
            }).responseText;
			
			if (admin_type_del_do == "1") {
				toastr.success("成功删除 ID 为："+type_id+" 的帮助类型！");
				self.location.reload();
			} else {
				toastr.error("请勿提交非法数据！");
				self.location.reload();
			}
}